tobychui / arozos

Web Desktop Operating System for low power platforms, Now written in Go!
http://arozos.com
GNU General Public License v3.0
1.96k stars 140 forks source link

[Feature Request]Enhancing ArozOS with Electron App Integration #115

Closed Secarian closed 8 months ago

Secarian commented 1 year ago

Is your feature request related to a problem? Please describe. As a user of ArozOS, I would like the ability to install and use Electron apps within the web desktop environment because there are many high-quality Electron apps that would greatly enhance the functionality of ArozOS. Currently, there is no straightforward way to use Electron apps within ArozOS.

Describe the solution you'd like I would like a feature that allows for the easy installation and use of Electron applications within ArozOS. This would include a streamlined process for embedding Electron apps within ArozOS, as well as the necessary APIs and libraries for communication between the Electron app and ArozOS. The feature should also include a user-friendly interface for managing Electron apps within ArozOS.

Describe alternatives you've considered I have not found any alternative solutions that would allow me to easily use Electron apps within ArozOS.

Additional context This feature would greatly improve the functionality and capabilities of ArozOS by allowing users to access and use a wide range of Electron apps. The ability to easily install and use Electron apps within ArozOS would also make it a more attractive option for users who are looking for a web desktop environment.

tobychui commented 1 year ago

Hi @Secarian ,

Short Answer It is possible to use Electron Apps (or other webapps that has a web interface) with ArozOS using the subservice interface. Here is an example of such use case with Syncthing https://github.com/aroz-online/syncthing

What you need is a simple config file and some bash script to glue them together. (Note the .startscript, moduleInfo.json and start.sh file)

Long Answer The above solution is only design for single user. If you have multiple users using the same server, the setup above will breaks the user environment sandbox design guideline (i.e. you and other users will see the same instance / state of the subservice interface mounted webapp)

There are a few reasons why ArozOS did not support existing webapps (like Electrons, React or others) out of the box. It is because of its complexity in sandbox and user isolated environment where normal webapps cannot be installed without big rewrites.

We did consider solving this in previous development cycles and here is what we had came up with image However, in order to maintain sandbox and user isolation requirements, you will need to create a docker container per user per app and keep such FUSE mount connection to the local file server which exposes the virtual file system layer. We think that this is too computational heavy for SBCs and that is why we didn't include it out of the box.

Still, if you are interested to work on this project, feel free to create a subservice just for high power server. We can include them in the official list of WebApps and subservice for others to reference.

If there are no further issue, I will be closing this enhancement request.

markusbkk commented 1 year ago

I don't think this is feasible the way @Secarian intends this. Not without tons of additional work anyways. Electron apps bundle Chromium/V8. They aren't just simple PWAs but include an entire render process.

Without introducing a display protocol Chromium understands, there's no way to render those Electron app windows.

I'm currently busy with another project (I'm working on an alternative to node/bun/deno) but my idea to make this (and other GUI apps) work was to implement something like Greenfield.

Secarian commented 1 year ago

I actually have to agree with you, Greenfield seems to be the better option. Just one more clarification question? Wouldn't Docker still be required to provide the container for the application runtime environment?

markusbkk commented 1 year ago

I actually have to agree with you, Greenfield seems to be the better option. Just one more clarification question? Wouldn't Docker still be required to provide the container for the application runtime environment?

Yea. The Docker requirement is accurate. Although I think you'd only need to dockerize the Wayland compositor for most use cases.

tobychui commented 8 months ago

As for now we don't have plan to support docker based Electron Apps (and WebVNC or X Client). I will close this but keeping #114 just in case someone is interested to add docker support.