cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.15k stars 1.11k forks source link

Support for web interfaces of various services #18674

Open allisonkarlitskaya opened 1 year ago

allisonkarlitskaya commented 1 year ago

Pie in the sky feature idea:

I use cockpit-podman to run a number of services as containers on a small home server:

One thing I start to notice is that all of these things have web interfaces of their own and doing "admin stuff" on my server often involves interacting with those interfaces.

Home Assistant OS supports add-ons in the form of containers and part of the specification of a add-on involves being able to declare a web "ingress". That's documented here: https://developers.home-assistant.io/docs/add-ons/presentation/

There's also a nice video here: https://www.home-assistant.io/blog/2019/04/15/hassio-ingress/

You get a nice "Open Web UI" button from the container config. I think this works even if the web port of the container isn't publicly available. It can also be done in a way that bypasses authentication, if the service supports that. Newer versions of Home Assistant can also add the web interface for a given add-on to the left navigation panel.

It would be pretty interesting to have some feature like this in Cockpit as a way to present access to running containers. We might imagine some kind of a label on the container as metadata for expressing the availability of a web interface on a given port.

garrett commented 1 year ago

I had a super old (at this point) idea to be able to add apps to Cockpit's apps section which would open up 3rd party apps without having to do anything special. As the containers (and VMs) export local ports, it would even work for this. It would basically be about registering:

Related:

garrett commented 1 year ago

Here's a quick mockup of a modal at how adding an app could work in a very generic and flexible way (regardless of locally installed package, container, VM, or whatever):

add application mockup

We'd want to add functionality for this to the applications page. And we'd want to make a different version with location prefilled and selectable for Cockpit-Podman, which would help automate this process and add it directly from the container row. (Possibly the same for Cockpit-Machines too, really.)

champtar commented 1 year ago

If it's ever implemented, please add an option for dynamic hostname (window.location.hostname), and possibility to add it dynamically via configuration in /run somewhere.

Right now I use cockpit to enable / disable some 'products' to run on the server + dynamically update a manifest.json + template some html + call parent.location.reload(true), it works but is hacky as hell