Open kimsible opened 4 years ago
According to the discussion on this PR, I propose these next steps :
[ ] Add to the admin panel the ability to upload PNG favicon and SVG logo (without any treatment, only format / extension checking)
[ ] ~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
[ ] Add plugin hook when uploading SVG logo and PNG favicon
[ ] Add Jimp processImage
to plugin server helpers
[ ] Add a plugin hook in the dymamic manifest : https://github.com/Chocobozzz/PeerTube/blob/176000efee51b0a8d91e8dc34e5d7b3c87a5c1df/server/controllers/client.ts#L160
[ ] ~Improve the router plugin : restrict writing files to an isolated directory~ maybe a flag like trusted plugin are planned ?
[ ] Add action to update contentHash of manifest / logo / favicon to plugin API
[ ] 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 ?
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.
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.
@kontrollanten most servers are not (re)building their code.
No, but most servers build their code ;) As I mentioned I think this is a one time configuration that is done during installation.
@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 :/
@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 ?
Reviving a dead thread. I updated the manifest.webmanifest
file, and even tried setting an NGINX route to /manifest.json
but it doesn't seem like it's possible to brand/add instance favicon to the PWA install.
If you want to change PWA icon, try to add the following paths in your client_overrides directory:
assets/images/icons/icon-36x36.png
assets/images/icons/icon-48x48.png
assets/images/icons/icon-72x72.png
assets/images/icons/icon-96x96.png
assets/images/icons/icon-144x144.png
assets/images/icons/icon-192x192.png
assets/images/icons/icon-512x512.png
Thanks, but that didn't seem to work.
/var/www/peertube/storage/client_overrides/assets/images/icons/icon-36x36.png
is the correct structure for this, right?
/var/www/peertube/storage/client_overrides/assets/images/icons/icon-36x36.png is the correct structure for this, right?
Yes. You can check:
'/var/www/peertube/storage/client-overrides/'
(and not client_overrides
)Everything is correct there. Hm. Maybe I have to make the icons the actual size.
It's not showing up in the PWA for Brave but it is in Firefox, so I'm guessing it's installed correctly.
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 :This plugin would also :
For the last feature, I think a hook would be required to trigguer any change of the name and description instance.